package punctuatedEquilibriumTest;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import punctuatedEquilibrium.Phenotype;
import punctuatedEquilibrium.PhenotypeFactory;
import punctuatedEquilibrium.Population;
import punctuatedEquilibrium.SimulationParameterFactory;
import punctuatedEquilibrium.SimulationParameters;

public class PopulationTest {

	private Population	population;

	@Before
	public void setUp() {
		SimulationParameters parameters = SimulationParameterFactory
				.standardParameters();
		population = new Population(parameters);
	}

	@Test
	public void testCreate() {
		assertNotNull(population);
	}

	@Test
	public void testSimulateGeneration() {
		Phenotype aPhenotype = PhenotypeFactory.getStandardPhenotype();
		population.simulateOneGeneration(aPhenotype);
		population.simulateOneGeneration(aPhenotype);
		Phenotype newPhenotype = population.reportAverageTraits();
		assertFalse(aPhenotype.isEquivalent(newPhenotype));
	}
}
